package lab02.test19;

public class Test {
    public static void main(String[] args) {
        String string = "HellOwoRD";
        StringBuffer stringBuffer = new StringBuffer();
        for (int i = 0;i < string.length();i++){
            char tmp = string.charAt(i);
            if (tmp > 'a' && tmp < 'z'){
                tmp = (char)(tmp -32);
                stringBuffer.append(tmp);
            }else if (tmp > 'A' && tmp < 'Z'){
                tmp = (char)(tmp +32);
                stringBuffer.append(tmp);
            }
        }
        System.out.println(stringBuffer.reverse());

    }
}
